

<%@ page import="mms.Person" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'person.label', default: 'Person')}" />
        <title><g:message code="default.edit.label" args="[entityName]" /></title>
            <js:jgrowl/>
            <js:ajaxupload/>
            <g:javascript src="person/edit.js" />
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
            <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>
            <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
        </div>
        <div class="body">
            <h1><g:message code="default.edit.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${personInstance}">
            <div class="errors">
                <g:renderErrors bean="${personInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form method="post" >
                <g:hiddenField name="id" value="${personInstance?.id}" />
                <g:hiddenField name="version" value="${personInstance?.version}" />
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="name"><g:message code="person.name.label" default="Name" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: personInstance, field: 'name', 'errors')}">
                                    <g:textField name="name" value="${personInstance?.name}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="sex"><g:message code="person.sex.label" default="Sex" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: personInstance, field: 'sex', 'errors')}">
                                    <g:checkBox name="sex" value="${personInstance?.sex}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="education"><g:message code="person.education.label" default="Education" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: personInstance, field: 'education', 'errors')}">
                                    <g:select name="education" from="${personInstance.constraints.education.inList}" value="${personInstance?.education}" valueMessagePrefix="person.education"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="school"><g:message code="person.school.label" default="School" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: personInstance, field: 'school', 'errors')}">
                                    <g:textField name="school" value="${personInstance?.school}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="office"><g:message code="person.office.label" default="Office" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: personInstance, field: 'office', 'errors')}">
                                    <g:textField name="office" value="${personInstance?.office}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="age"><g:message code="person.age.label" default="Age" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: personInstance, field: 'age', 'errors')}">
                                    <g:textField name="age" maxlength="120" value="${personInstance?.age}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="description"><g:message code="person.description.label" default="Description" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: personInstance, field: 'description', 'errors')}">
                                    <g:textArea name="description" cols="40" rows="5" value="${personInstance?.description}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="cardID"><g:message code="person.cardID.label" default="Card ID" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: personInstance, field: 'cardID', 'errors')}">
                                    <g:textField name="cardID" value="${personInstance?.cardID}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="interest"><g:message code="person.interest.label" default="Interest" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: personInstance, field: 'interest', 'errors')}">
                                    <g:textField name="interest" value="${personInstance?.interest}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="address"><g:message code="person.address.label" default="Address" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: personInstance, field: 'address', 'errors')}">
                                    <g:textField name="address" value="${personInstance?.address}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="multimedia"><g:message code="person.multimedia.label" default="Multimedia" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: personInstance, field: 'multimedia', 'errors')}">
                                    <g:select name="multimedia" from="${mms.Multimedia.list()}" multiple="yes" optionKey="id" size="5" value="${personInstance?.multimedia*.id}" />
                                </td>
                            </tr>
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" /></span>
                    <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
